#include <stdio.h>
#include <string.h>

#define MAX_SIZE 2048

int main(int argc, char *argv[])
{
	char str[MAX_SIZE], *p;
	int n;

	scanf("%s %d", str, &n);

	p = strstr(str, ".");

	if (p-str+n > strlen(str)) {
		printf("0\n");
	} else {
		printf("%c\n", str[p-str+n]);
	}

	return 0;
}
